import "./utils/reset.css";

import Vue from "vue";
import App from "./App.vue";

import router from "./router";
import "./utils/rem";
import $ from "jquery";
import Cookies from "js-cookie";
import VConsole from "vconsole";
// new VConsole();
import {
    Search,
    Form,
    Field,
    NoticeBar,
    Icon,
    Switch,
    Radio,
    Popup,
    List,
    Picker,
    DatetimePicker,
    DropdownMenu,
    DropdownItem,
    Swipe,
    SwipeItem,
    Lazyload,
} from "vant";

Vue.use(Form)
    .use(Icon)
    .use(Switch)
    .use(Radio)
    .use(Popup)
    .use(List)
    .use(Picker)
    .use(DatetimePicker)
    .use(DropdownMenu)
    .use(DropdownItem)
    .use(Swipe)
    .use(SwipeItem)
    .use(Lazyload);
Vue.use(Field);
Vue.use(Search);
Vue.use(NoticeBar);
import VueI18n from "vue-i18n";
import { Locale } from "vant";

// 引入英文语言包
import zhLocale from "vant/es/locale/lang/zh-CN";
import enLocale from "vant/es/locale/lang/en-US";

Vue.use(VueI18n);

Locale.use("zh-CN", zhLocale);
Locale.use("en-US", enLocale);

const i18n = new VueI18n({
    locale: Cookies.get("locale") || "zh", // 语言标识
    messages: {
        zh: require("./i18n/langs/zn"),
        en: require("./i18n/langs/en"),
    },
});

import "./permission"; // 路由权限

Vue.config.productionTip = false;

window.$ = $;
Vue.prototype.$cookies = Cookies;

new Vue({
    router,
    i18n,
    render: (h) => h(App),
}).$mount("#app");
